Grouping Constructs
A Grouping Construct separates a regular expression into subexpressions.
Regular Expression | Description |
---|---|
(subexpression) | Captures any matched subexpressions and assigns an instance number to the matches, which you can access using \[Instance Number]. |
(?: subexpression) | Creates a group that will not capture the string matched by the group. |
(? <> expr) | Creates a named capture group for future use in the regular expression. |
\k<> | References a named capture group created in the expression. Matches the string captured by that capture group. |